<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>用户</title>
        <link rel="stylesheet" href="__PUBLIC__/css/bootstrap.min.css">
        <link rel="stylesheet" href="__PUBLIC__/css/nav.css"> 
        <script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>    
        <script type="text/javascript" src="__PUBLIC__/js/bootstrap.min.js"></script>

    </head>
    <body>
        <table class="table panel-info bshadow" >
            <thead>
                <tr class="success">
                    <th>序号</th>
                    <th>账号</th>
                    <th>姓名</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
            <volist name="list" id="vo">
                <tr>
                    <td>{$i}</td>
                    <td>{$vo.useraccount}</td>
                    <td>{$vo.name}</td>
                <td><a href="__CONTROLLER__/alter1/id/{$id}/user/{$vo.useraccount}">选择</a></td>
             </tr>
            </volist>
        </tbody>
        <script>
            function admin(it) {
                if ($(it).is(':checked')) {
                    ajax(it.value, 1)
                } else {
                    ajax(it.value, 0)
                }
            }
            function ajax(t, v) {
                // var val=jQuery("#"+obj).val();
                $.ajax({
                    url: "__ROOT__/Admin/User/admin", //这里指向的就不再是页面了，而是一个方法。
                    data: {
                        val: v,
                        tea: t
                    },
                    type: "POST",
                    dataType: "JSON",
                    success: function (data) {
                        $(data).each(function (i) {
                            if (data.val == 0) {
                                alert('设置失败')
                            } else {
                                alert('设置成功')
                            }
                            //str += "<option value='"+data[i].d+"'>"+data[i].n+"</option>";
                        });
//                             $('#banji').empty();
//                             $('#banji').append(str);
                    }
                });
            }
        </script>
        <tfoot>
            <tr class="active">
                <td colspan="9">
                    <div class="left">
                        <i class="i"></i>
                        <input type="button" value="返回" class="btn btn-success" onclick="window.history.go(-1)">
                    </div>
                    {$page}
                </td>
            </tr>
        </tfoot>
    </table>
</body>
</html>